package com.solution.framework.model;

import com.solution.framework.util.JsonUtil;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * Busline: sunguangzhu
 * Date: 13-7-6
 * Time: 下午1:01
 * To change this template use File | Settings | File Templates.
 */
@MappedSuperclass
public class BaseBean implements Serializable {
    //    private String id;
    private Long id;

    private String description;

    private Date createTime;

    private String createUser;

    private Date updateTime;

    private String updateUser;

    @Id
   /* @GeneratedValue(generator = "system-uuid")
    @GenericGenerator(name = "system-uuid", strategy = "uuid.hex")*/
    @GeneratedValue
    @Column(name = "id", unique = true, nullable = false)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
   /* public java.lang.String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }*/

    @Column
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Column
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Column
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Override
    public String toString() {
        return JsonUtil.transformObjectToString(this);
    }
}
